package com.lagou.server.service.dto;

import java.io.IOException;

/**
 * 序列化接口
 * @author yzh
 */
public interface Serializer {

    /**
     * 序列化的方法
     * @param object
     * @return
     * @throws IOException
     */
    public byte[] serialize(Object object) throws IOException;

    /**
     * 反序列化的方法
     * @param clazz
     * @param bytes
     * @param <T>
     * @return
     * @throws IOException
     */
    public <T> T deserialize(Class<T> clazz, byte[] bytes) throws IOException;

}
